Skip to content

[READY FOR REVIEW] Add doc strings, avoid traps#21

Open
timohanke wants to merge 17 commits intodfinity:mainfrom
research-ag:doc-strings
Open

[READY FOR REVIEW] Add doc strings, avoid traps#21
timohanke wants to merge 17 commits intodfinity:mainfrom
research-ag:doc-strings

Conversation

@timohanke
Copy link
Copy Markdown
Contributor

@timohanke timohanke commented Apr 24, 2026

  • Add doc string to all functions and public objects
  • Bugfix: Bech32.decode() falsely rejected all-numeric input

Writing the doc strings brought to light inconsistent error case behaviour. Some errors trapped, some returned #err. This was fixed:

  • Add input checks in Wif.decode(), Segwit.encode()
  • Make non-trapping:
    • Base58Check.decode()
    • Address.addressFromText()
    • P2pkh.decodeAddress()
    • P2pkh.decodeAddress()
    • P2pkh.makeScript()
    • Address.scriptPubKey()
    • Bitcoin.buildTransaction()
    • Wif.decode()

@timohanke timohanke requested a review from a team as a code owner April 24, 2026 20:10
@timohanke timohanke changed the title Add doc strings, avoid traps [READY FOR REVIEW] Add doc strings, avoid traps Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants